﻿using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace DataFileApp_WPF.Models
{
    public class DataGridItem : INotifyPropertyChanged
    {
        public int HeaderIndex { get; set; }
       // public string Key { get; set; }
      //  public object Value { get; set; }
      //  public string Type { get; set; }

        public ObservableCollection<string> DropDowmList { get; set; }
        public  string Comment { get; set; }


        public ObservableCollection<DataGridItem> DataGridCols { get; set; }
        public DataGridItem()
        {
            DataGridCols = new ObservableCollection<DataGridItem>();
            DropDowmList = new ObservableCollection<string>();
        }

        public event PropertyChangedEventHandler PropertyChanged;

        private string _key;
        public string Key
        {
            get { return _key; }
            set
            {
                if (_key != value)
                {
                    _key = value;
                    OnPropertyChanged(nameof(Key));
                }
            }
        }
        private object _value;
        public object Value
        {
            get { return _value; }
            set
            {
                if (_value != value)
                {
                    _value = value;
                    OnPropertyChanged(nameof(Value));
                }
            }
        }

        private string _type;
        public string Type
        {
            get { return _type; }
            set
            {
                if (_type != value)
                {
                    _type = value;
                    OnPropertyChanged(nameof(Type));
                }
            }
        }
        protected virtual void OnPropertyChanged(string propertyName)
        {
            PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
        }
    }
}
